<?php 
/*
 * @Author: Terry
 * @Date: 2024-09-12 22:14:26
 * @LastEditors: Terry
 * @LastEditTime: 2024-10-31 16:32:25
 * @Description: 有限空间路由
 * @FilePath: \auxface_api\app\confinedSpace\route\route.php
 */

use think\facade\Route;

//管理端路由api
Route::group('admin/v1/', function () {

    //数据概览
    Route::group('overView/',function(){
        Route::get('getData', 'overView/getData');//首页概览
        Route::get('getDetail', 'overView/getDetail');//气体检测
        Route::get('getHistory', 'overView/getHistory');//查看气体检测仪设备详细数据
        Route::get('getGasDetail', 'overView/getGasDetail');//获取气体检测仪的详情
    })->middleware(['checkAuth','checkData','checkLogin']);
  
    
    //气体监测
    Route::group('gas/',function(){
        Route::group('/',function(){
            Route::get('getList', 'gas/getList');//获取气体检测仪设备列表
            Route::post('create', 'gas/create');//添加气体检测仪设备
            Route::put('update', 'gas/update');//更新气体检测仪设备信息
            Route::delete('destroy', 'gas/destroy');//删除气体检测仪设备
            Route::get('getDetail', 'gas/getDetail');//查看气体检测仪设备详细数据
        })->middleware(['checkAuth','checkData']);

        Route::get('getOptions', 'gas/getOptions');//获取气体设备字典数据
    })->middleware(['checkLogin']);

    
    //摄像头
    Route::group('camera/',function(){
        Route::group(function(){
            Route::get('getList', 'camera/getList');//获取摄像头列表
            Route::get('getChannelData', 'camera/getChannelData');//获取摄像头/nvr 通道信息
            Route::get('getChannelList', 'camera/getChannelList');//获取子通道数据
            Route::post('create', 'camera/create');//设备添加
            Route::put('update', 'camera/update');//设备更新
            Route::delete('destroy', 'camera/destroy');//设备删除
            Route::get('getCameraDetail', 'camera/getCameraDetail');//获取设备详情信息
            Route::post('changeStatus', 'camera/changeStatus');//获取设备详情信息
            Route::get('getNvrChannel', 'camera/getNvrChannel');//获取nvr所有通道信息
            Route::get('refreshChannel', 'camera/refreshChannel');//重新获取子通道信息
            Route::get('getCloudList', 'camera/getCloudList');//重新获取子通道信息
            Route::get('getCloudDate', 'camera/getCloudDate');//重新获取子通道信息
        })->middleware(['checkAuth','checkData']);
        
        Route::get('getDic', 'camera/getDic');//获取设备详情信息
    })->middleware(['checkLogin']);

    //视频播放
    Route::group("realtime/",function(){
        Route::get('getList', 'realtime/getList');//视频播放列表
        Route::put('update', 'realtime/update');//视频播放列表更新
        Route::post('cameraControl', 'realtime/cameraControl');//视频播放列表更新
    })->middleware(['checkLogin','checkAuth','checkData']);

    //账号设置
    Route::group('config/',function(){
        Route::get('getList', 'config/getList');//视频播放列表 
        Route::post('create', 'config/create');//视频播放列表 
        Route::put('update', 'config/update');//视频播放列表 
        Route::delete('destroy', 'config/destroy');//视频播放列表 
    })->middleware(['checkLogin','checkAuth','checkData']);

})->prefix('admin.v1.')->middleware('dataEncryption');
